from day01.basecla import BaseClass
from day01.basecla import driver
from selenium.webdriver.common.by import By
from time import sleep
c=BaseClass()
c.open_browser('file:///E:/%E8%93%AC%E8%8E%B1%E5%B0%8F%E8%AF%BE2024%E6%B5%8B%E8%AF%95/%E7%AC%AC%E5%9B%9B%E9%98%B6%E6%AE%B5/Selenium%E8%87%AA%E5%8A%A8%E5%8C%96/selenium_demo/day04demo/demo02.html')
locator=[By.CLASS_NAME,By.ID,By.XPATH,By.NAME,By.CSS_SELECTOR]
airplan=driver.find_element(locator[4],'#a')
bus=driver.find_element(locator[2],'//input[@id="b"]')
rainway=driver.find_element(locator[1],'c')
mydrive=driver.find_element(locator[2],'//input[@id="d"]')
t2=driver.find_element(locator[1],'t2')
if airplan.is_selected():
    str1=airplan.get_attribute('value')
elif bus.is_selected():
    str1=bus.get_attribute('value')
elif rainway.is_selected():
    str1=rainway.get_attribute('value')
else:
    str1=mydrive.get_attribute('value')
t2.send_keys(str1)
sleep(2)
airplan.click()
t2.clear()
t2.send_keys('最喜欢',str1,'出行了')
sleep(2)
driver.quit()